import { ElNotification, ElMessageBox } from "element-plus";
import nprogress from "nprogress";

const toast = (message, type = "success", dangerouslyUseHTMLString = false) => {
  ElNotification({
    message,
    type,
    dangerouslyUseHTMLString,
    duration: 2000,
  });
};

const showModal = (content = "提示内容", type = "warning", title = "") => {
  return ElMessageBox.confirm(content, title, {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type,
  });
};


// 显示全屏loading
const showFullLoading = ()=>{
  nprogress.start()
}

// 隐藏全屏loading
const hideFullLoading = ()=>{
  nprogress.done()
}
export { toast, showModal, showFullLoading, hideFullLoading };
